<?php

namespace Tbf\Bundle\JpushBundle;

class Message
{
    const RECEIVER_TYPE_ALL=4;
    const MSG_TYPE_NOTICE=1;
    const PLATFORM_ANDROID='android';
    const PLATFORM_IOS='ios';
    protected $sendno;
    protected $receiver_type;
    protected $receiver_value;
    protected $msg_type = self::MSG_TYPE_NOTICE;
    protected $platforms = array();
    protected $time_to_live;

    protected $msg_title;
    protected $msg_content;
    protected $msg_extras;
    public function __construct()
    {
        $this->addPlatForm(self::PLATFORM_ANDROID);
        $this->addPlatForm(self::PLATFORM_IOS);
    }
    public function addPlatForm($platform)
    {
        $this->platforms[] = $platform;
    }
    public function sendToAll()
    {
        $this->receiver_type = self::RECEIVER_TYPE_ALL;
        $this->receiver_value = null;
    }
    /**
     * @param mixed $msg_content
     */
    public function setMsgContent($msg_content)
    {
        $this->msg_content = $msg_content;
    }

    /**
     * @return mixed
     */
    public function getMsgContent()
    {
        return $this->msg_content;
    }

    /**
     * @param mixed $msg_extras
     */
    public function setMsgExtras($msg_extras)
    {
        $this->msg_extras = $msg_extras;
    }

    /**
     * @return mixed
     */
    public function getMsgExtras()
    {
        return $this->msg_extras;
    }

    /**
     * @param mixed $msg_title
     */
    public function setMsgTitle($msg_title)
    {
        $this->msg_title = $msg_title;
    }

    /**
     * @return mixed
     */
    public function getMsgTitle()
    {
        return $this->msg_title;
    }

    /**
     * @param mixed $msg_type
     */
    public function setMsgType($msg_type)
    {
        $this->msg_type = $msg_type;
    }

    /**
     * @return mixed
     */
    public function getMsgType()
    {
        return $this->msg_type;
    }

    /**
     * @param mixed $platform
     */
    public function setPlatforms(array $platforms)
    {
        $this->platforms = $platforms;
    }

    /**
     * @return mixed
     */
    public function getPlatforms()
    {
        return $this->platforms;
    }

    /**
     * @param mixed $receiver_type
     */
    public function setReceiverType($receiver_type)
    {
        $this->receiver_type = $receiver_type;
    }

    /**
     * @return mixed
     */
    public function getReceiverType()
    {
        return $this->receiver_type;
    }

    /**
     * @param mixed $receiver_value
     */
    public function setReceiverValue($receiver_value)
    {
        $this->receiver_value = $receiver_value;
    }

    /**
     * @return mixed
     */
    public function getReceiverValue()
    {
        return $this->receiver_value;
    }

    /**
     * @param mixed $sendno
     */
    public function setSendno($sendno)
    {
        $this->sendno = $sendno;
    }

    /**
     * @return mixed
     */
    public function getSendno()
    {
        return $this->sendno;
    }

    /**
     * @param mixed $time_to_live
     */
    public function setTimeToLive($time_to_live)
    {
        $this->time_to_live = $time_to_live;
    }

    /**
     * @return mixed
     */
    public function getTimeToLive()
    {
        return $this->time_to_live;
    }

}
